<?php require_once 'conn.php'; require_once './statusCode.php'; $statusCode = $_POST['statusCode']; $userphone = $_POST['userphone']; $newPasswd = $_POST['newPasswd']; if (isset($statusCode) && isValidStatusCode($statusCode)){ $upsql = $conn->prepare("UPDATE userdata SET passwd = ? WHERE phone = ?"); $upsql->bind_param('ss', $newPasswd, $userphone); if($upsql->execute() === TRUE){ header('Content-Type: application/json'); echo json_encode([ 'errno' => 0, 'message' => '密码修改成功！' ]); }else{header('Content-Type: application/json'); echo json_encode([ 'errno' => 1, 'message' => '系统出错啦，请重试一下啦！！！' ]);} }else{header('Content-Type: application/json'); echo json_encode([ 'errno' => 1, 'message' => '无权访问！！！' ]);} ?>  